{% extends "shared/layout.volt" %}
{% block content %}
    <h1 class="page-header">交易详情</h1>
    <div class="form-box form-app-box">
        <div class="form-title-box">
            <h3 class="view-title">基础信息</h3>
        </div>
        <table class="table-detail">
            <tbody>
            <tr>
                <td>商户订单号</td>
                <td>{{ Order.order_no }}</td>
            </tr>
            <tr>
                <td>交易流水号</td>
                <td>{{ Order.transaction_id }}</td>
            </tr>
            <tr>
                <td>商家编号</td>
                <td>{{ Order.merchant_id }}</td>
            </tr>
            <tr>
                <td>第三方交易流水号</td>
                <td>{{ Order.out_transaction_id?Order.out_transaction_id:'[无]' }}</td>
            </tr>
            <tr>
                <td>交易渠道</td>
                <td>{{ Order.trade_channel_text }}</td>
            </tr>
            <tr>
                <td>交易状态</td>
                <td>{{ Order.trade_state_text }}</td>
            </tr>
            <tr>
                <td>订单标题</td>
                <td>{{ Order.order_subject }}</td>
            </tr>
            <tr>
                <td>货币类型</td>
                <td>{{ Order.currency_text }}</td>
            </tr>
            <tr>
                <td>订单金额</td>
                <td>{{ Order.total_amount }}</td>
            </tr>
            <tr>
                <td>优惠金额</td>
                <td>{{ Order.discount_amount }}</td>
            </tr>
            <tr>
                <td>买家标识</td>
                <td>{{ Order.buyer_id }}</td>
            </tr>
            <tr>
                <td>卖家标识</td>
                <td>{{ Order.seller_id?Order.seller_id:'[无]' }}</td>
            </tr>
            <tr>
                <td>店铺编号</td>
                <td>{{ Order.store_id?Order.store_id:'[无]' }}</td>
            </tr>
            <tr>
                <td>商户操作员编号</td>
                <td>{{ Order.operator_id?Order.operator_id:'[无]' }}</td>
            </tr>
            <tr>
                <td>终端编号</td>
                <td>{{ Order.terminal_id?Order.terminal_id:'[无]' }}</td>
            </tr>
            <tr>
                <td>创建时间</td>
                <td>{{ Order.time_start }}</td>
            </tr>
            <tr>
                <td>支付时间</td>
                <td>{{ Order.time_end?Order.time_end:'[无]' }}</td>
            </tr>
            </tbody>
        </table>
        {% if OrderDetailList is not empty %}
        <div class="form-title-box">
            <h3 class="view-title">商品信息</h3>
        </div>
        <table class="table-tidy">
            <thead class="table-tidy-head">
            <tr>
                <th style="width: 120px;">商品编号</th>
                <th style="width: 300px;">商品名称</th>
                <th>商品简介</th>
                <th style="width: 100px;">商品数量</th>
                <th style="width: 100px;">商品单价</th>
                <th style="width: 120px;">商品分类</th>
            </tr>
            </thead>
            <tbody class="table-tidy-body">
            {% for item in OrderDetailList %}
            <tr>
                <td>{{ item.goods_id }}</td>
                <td>
                    <img src="{{ item.image_url }}" onerror="this.src={{ static_url('assets/images/default_goods_image_240.gif') }}" style="display: inline-block;width: 40px;height: 40px;margin-right: 20px;">
                    <span class="text-name">
                        {% if item.show_url is not empty %}
                            <a href="{{ item.show_url }}" target="_blank" title="{{ item.goods_name|e }}">{{ item.goods_name|e }}</a>
                        {% else %}
                            {{ item.goods_name|e }}
                        {% endif %}
                    </span>
                </td>
                <td>{{ item.body|e }}</td>
                <td>{{ item.quantity }}</td>
                <td>{{ item.price }}</td>
                <tD>{{ item.goods_category|e }}</tD>
            </tr>
            {% endfor %}
            </tbody>
        </table>
        {% endif %}
        <div style="margin-top: 30px;">
            <button type="button" class="btn btn-success btn-s" onclick="window.document.location=document.referrer;">返回</button>
        </div>

    </div>
{% endblock %}